package xuegao.study.mall.admin.feign;

import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.*;
import xuegao.study.mall.common.api.CommonPage;
import xuegao.study.mall.common.api.CommonResult;
import xuegao.study.mall.common.dto.OmsReturnApplyQueryParam;
import xuegao.study.mall.common.dto.OmsUpdateStatusParam;
import xuegao.study.mall.common.model.oms.OmsOrderReturnApply;

import java.util.List;

@FeignClient(contextId = "return-apply", name = "study-order-service", path = "/oms/returnApply")
public interface OmsOrderReturnApplyClient {

    @ApiOperation("分页查询退货申请")
    @GetMapping(value = "/list")
    CommonResult<CommonPage<OmsOrderReturnApply>> list(
            @SpringQueryMap OmsReturnApplyQueryParam queryParam,
            @RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
            @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum);

    @ApiOperation("批量删除退货申请")
    @PostMapping(value = "/delete")
    CommonResult delete(@RequestParam("ids") List<Long> ids);

    @ApiOperation("获取退货申请详情")
    @GetMapping(value = "/{id}")
    CommonResult getItem(@PathVariable Long id);

    @ApiOperation("修改退货申请状态")
    @PostMapping(value = "/update/status/{id}")
    CommonResult updateStatus(@PathVariable Long id, @RequestBody OmsUpdateStatusParam statusParam);
}
